import request from '@/config/axios'

// 专家内容 API
export const ContentExpertApi = {
  // 查询专家内容分页
  getContentExpertPage: async (params: any) => {
    return await request.get({ url: `/cms/content-expert/page`, params })
  },
  getContentExpert: async (id: number) => {
    return await request.get({ url: `/cms/content-expert/get?id=${id}` })
  },

  getByMenuId: async (menuId: number) => {
    return await request.get({ url: `/cms/content-expert/getByMenuId?menuId=${menuId}` })
  },

  // 新增专家内容
  createContentExpert: async (data: any) => {
    return await request.post({ url: `/cms/content-expert/create`, data })
  },

  // 修改专家内容
  updateContentExpert: async (data: any) => {
    return await request.put({ url: `/cms/content-expert/update`, data })
  },

  // 删除专家内容
  deleteContentExpert: async (id: number) => {
    return await request.delete({ url: `/cms/content-expert/delete?id=` + id })
  },

  // 导出专家内容 Excel
  exportContentExpert: async (params) => {
    return await request.download({ url: `/cms/content-expert/export-excel`, params })
  },
}
